Row

S&P 500

Row

Price to Earnings Ratio - S&P 500

Price to Sales Ratio - S&P 500

Market Cap to GDP - US

Volatility Index (VIX)

---
title: "Market Indicators"
author: "Charlotte McClintock"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code: embed
---

```{r setup, include=FALSE}

library(knitr)
library(tidyverse)
library(shiny)
library(plotly)
library(DT)
library(shinythemes)
library(markdown)
library(rsconnect)
library(ggplot2)

load("stockmkt.Rdata")
```


Row
-----------------------------------------------------------------------

### S&P 500

```{r}
p <- ggplot(SP, aes(x=date, y=sp500)) +
            geom_point(size = 1, color='darkblue') + geom_line(color='darkblue')     
ggplotly(p)
```



Row {.tabset}
-----------------------------------------------------------------------

### Price to Earnings Ratio - S&P 500

```{r}
p <- ggplot(PER, aes(x=date, y=price2earnings)) +
            geom_point(size = 1, color='darkred') + geom_line(color='darkred')
ggplotly(p)
```

### Price to Sales Ratio - S&P 500

```{r}
p <- ggplot(PSR, aes(x=date, y=price2sales)) +
            geom_point(size = 1, color='green') + geom_line(color='green')
ggplotly(p)
```

### Market Cap to GDP - US

```{r}
p <- ggplot(data = mktcap2gdp, aes(x = date, y = mktcap2gdp)) + 
        geom_point(size = 1, color='orange') + geom_line(color='orange')
ggplotly(p)
```

### Volatility Index (VIX)

```{r}
p <- ggplot(data = vix, aes(x = date, y = volatilityindex)) + 
        geom_point(size = 1, color='purple') + geom_line(color='purple')
ggplotly(p)
```